package sg4c.frontend.command;

import java.io.IOException;
import sg4c.frontend.GraphicsContext;
import sg4c.protocol.DataInputProtocol;

public class SetFont implements GraphicsCommand {

    
    public final int fontId;

    public SetFont(int fontId) {
        this.fontId = fontId;
    }

    public void execute(GraphicsContext context) {
        context.setFont(fontId);
    }
    public static Factory factory = new Factory() {

        public GraphicsCommand parse(DataInputProtocol in) throws IOException {
            int id = in.readInt();
            return new SetFont(id);
        }
    };
}
